<?php
/**
 * Junction_Sql_Expression_Tree
 * 
 * Models an expressin tree.
 * 
 * @author Patrick J. Mizer <patrick.mizer@gmail.com>
 */
 
using("Junction_Sql_Expression_Node"); 
using("Junction_Sql_Expression_Traverser");
 
class Junction_Sql_Expression_Tree 
{
	/**
	 * Root of expression tree
	 * 
	 * @var Junction_Sql_Expression_Node
	 */
	private $_root;
	
	/**
	 * Junction_Sql_Expression_Tree Constructor
	 * 
	 * @param Junction_Sql_Expression_Node
	 */
    public function __construct(Junction_Sql_Expression_Node $node) 
    {
    	$this->_root = $node;
    }
    
    /**
     * Traverses the tree in a manner defined by the traverser parameter.
     * 
     * @param Junction_Sql_Expression_Traverser
     */
    public function traverse(Junction_Sql_Expression_Traverser $traverser)
    {
    	return $traverser->traverse($this->_root);
    }
}
?>